UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+0+RfBz0lza+FmycfWFpaOhlb0URSmD52GkqCD8fSRE=' 
WHERE 
  key_id = 'c8e491a181a3692f9239c0a60a7aa4801ffe1c009f3f22a9b31ce4a4ab601d3e' 
  AND (
    token = '+0+RfBz0lza+FmycfWFpaOhlb0URSmD52GkqCD8fSRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016