UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hVHyzypZQdSclQNFK8FRiNtd9zVSt2Rj3/eKBPoRkq4=' 
WHERE 
  key_id = '35965cd6fcbe663efa49697049d3092b9c3bdaa4e7137ce0b5c4d0026d82e68a' 
  AND (
    token = 'hVHyzypZQdSclQNFK8FRiNtd9zVSt2Rj3/eKBPoRkq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021