UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oLKQ/RYvYse3PUE1Q8/faMe6R/hJwHN/A6TVeIa86ek=' 
WHERE 
  key_id = '66512434e0b8f2b830fe54100a792726850849a1d1b244ad3be7f7e83c06d3fa' 
  AND (
    token = 'oLKQ/RYvYse3PUE1Q8/faMe6R/hJwHN/A6TVeIa86ek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081