UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jwF/wcBT8x2OSn2/f/8DfKU86jM6HWeno/uQN5s9Ezs=' 
WHERE 
  key_id = '91d9843262d1ab1d86f2b2ece01dad823a422b688f3a82453e31549f9bfbc0b5' 
  AND (
    token = 'jwF/wcBT8x2OSn2/f/8DfKU86jM6HWeno/uQN5s9Ezs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057