UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Sq8WzXfRxH4DgnK1Nt/S9X78iY9LlPVg4zFpPoWKYTw=' 
WHERE 
  key_id = '3adb42e38847d464f09ec72ed45a5f0e331d4b639251994c9521191a7cbe5726' 
  AND (
    token = 'Sq8WzXfRxH4DgnK1Nt/S9X78iY9LlPVg4zFpPoWKYTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018