UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sXsjeF8qRjS0g7ZeTQuqINh6FexbRqpFVC2qfNrcfko=' 
WHERE 
  key_id = '93154e2cbdfad64d4c9b3eddea2d8bc2392052b6c399641b9b932acf0c455efc' 
  AND (
    token = 'sXsjeF8qRjS0g7ZeTQuqINh6FexbRqpFVC2qfNrcfko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031