UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CALB7qIOIV7L5jZRuy8/qHbuVIiflSeoNQ8ShwB3AIY=' 
WHERE 
  key_id = '51e76cbe7f3a4934ff978ae6b44eab41b9868acc983410f343f6f7a9f4461d65' 
  AND (
    token = 'CALB7qIOIV7L5jZRuy8/qHbuVIiflSeoNQ8ShwB3AIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028