UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ThE840A0YX+025yrnIRZ81EN5HTum79bdDe9T6kjeok=' 
WHERE 
  key_id = '910006e64e1c3656219dc5014fd8e46fbbe22f228762db872e359d541cb54f73' 
  AND (
    token = 'ThE840A0YX+025yrnIRZ81EN5HTum79bdDe9T6kjeok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028