UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfWzLC1blUiQ0Y0W92FdCgf7kJT5RjCDM5rAQ1btuNQ=' 
WHERE 
  key_id = '08c7a344058f94b282d57b0786f3633afda1e30dd9002ce860f40bc7d414785a' 
  AND (
    token = 'yfWzLC1blUiQ0Y0W92FdCgf7kJT5RjCDM5rAQ1btuNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031