UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IeLzkG1d4HK6hI9jxSdItsSJp/XmM29+w/EKhtCew3g=' 
WHERE 
  key_id = 'f4d49c453458864e4b6f80f8238e57aa2ca1887310e349692ffb8226e55d2caa' 
  AND (
    token = 'IeLzkG1d4HK6hI9jxSdItsSJp/XmM29+w/EKhtCew3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036