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

Query time 0.00025