UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FlxVbrBhDfogMewdqpn+W/hduGYANoqV8P7zMgSABcI=' 
WHERE 
  key_id = '55eb3b8f24891f6390907ddebafec941ad273b17af1173702e8c4588acbc5c8c' 
  AND (
    token = 'FlxVbrBhDfogMewdqpn+W/hduGYANoqV8P7zMgSABcI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029