UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L/Ba+Qlp+0hSr7b15tgz1yZ/8KQOzALVHLJuRTgX6C8=' 
WHERE 
  key_id = 'f16fee4649b10e48ffc69486bb6aade2ae8f026b52359b140ee3ed568d4926ea' 
  AND (
    token = 'L/Ba+Qlp+0hSr7b15tgz1yZ/8KQOzALVHLJuRTgX6C8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034