UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LX0pCmXOcvTPkfrmOAIAlUHvRZAOuyt2hVhTGCgRdmk=' 
WHERE 
  key_id = 'b40c666861b74685f12ebb42904e9805bbe7ba42cdbf75ec43cbea0639ecd494' 
  AND (
    token = 'LX0pCmXOcvTPkfrmOAIAlUHvRZAOuyt2hVhTGCgRdmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041