UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tzalB0FSbdu/AiMKuifEQ3kZBXuRy+XxxSmoh3MpNjc=' 
WHERE 
  key_id = '895ef7bca99aebe685bd10df967230e3aedecc5fb1711671d452b3f87b1648fa' 
  AND (
    token = 'tzalB0FSbdu/AiMKuifEQ3kZBXuRy+XxxSmoh3MpNjc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028