UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L+7OvSLTso3rCBHwpaa3cadjFyB/18s9qsgL0DIP/ic=' 
WHERE 
  key_id = '7e804d7641a143efd78935ae6ce9f86e8b0ac3ab6c722e49e55f2cc7877b020c' 
  AND (
    token = 'L+7OvSLTso3rCBHwpaa3cadjFyB/18s9qsgL0DIP/ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032