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

Query time 0.00031