UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ghldBWfaSsTxvKXKAU8QaufCG/4z10YaPmToZCywXWY=' 
WHERE 
  key_id = '704daf156e0f5f51b5e58c16d35c6fb76560d5d02ba0d42c53f32deca8f84fcd' 
  AND (
    token = 'ghldBWfaSsTxvKXKAU8QaufCG/4z10YaPmToZCywXWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022