UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QwRrg1qrkGp105fBko8FSMS3kHJ9uJwZAqOYjRRZKR4=' 
WHERE 
  key_id = '4e0cb95c5c81849ff73ae2262c7d9a61c30b2e42f19fca2afef30675e92e615b' 
  AND (
    token = 'QwRrg1qrkGp105fBko8FSMS3kHJ9uJwZAqOYjRRZKR4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054