UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SFz286ffpLCDJ7fDdgSJO5OzvpTtV4RimNfr9vaC9h4=' 
WHERE 
  key_id = '6e3b9c8cc3ef8e15d8854921add87e64b61d73d2cde1b1848e9f77020662ba1b' 
  AND (
    token = 'SFz286ffpLCDJ7fDdgSJO5OzvpTtV4RimNfr9vaC9h4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046