UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bIea+SZP9zleV3ucZKm5oZeBTDusGmz0/w6WHvo8/L8=' 
WHERE 
  key_id = 'aa7ac67ee4a6e0fc256c73aa080ea685546fd0c11b24d6f950d15905ee7d657a' 
  AND (
    token = 'bIea+SZP9zleV3ucZKm5oZeBTDusGmz0/w6WHvo8/L8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026