UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nhWb/u0CP4wFgLZpVBhPljV8rahrK1LrJ7Nr0PygorY=' 
WHERE 
  key_id = '590a44df8c43ae42eb1f1395263c543971e664f1eb7b1c5378c011f504786024' 
  AND (
    token = 'nhWb/u0CP4wFgLZpVBhPljV8rahrK1LrJ7Nr0PygorY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021