UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nkoIFr2376dLG/ltzZRZe2eAWr0YgT/JHjGIx5qL+t0=' 
WHERE 
  key_id = '4e733489561d910229482243019fd0fe7b9d44c579f536c77b20ce5e63ec43e9' 
  AND (
    token = 'nkoIFr2376dLG/ltzZRZe2eAWr0YgT/JHjGIx5qL+t0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041