UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gpmXp1nwvbYRGL4z5fg8gn+IHfGJFsKrTv+FXSDqsMU=' 
WHERE 
  key_id = '00359418d1df4cb5ee38effc84d6e012864e4cd1c4aabfef9e8f6be40684c05d' 
  AND (
    token = 'gpmXp1nwvbYRGL4z5fg8gn+IHfGJFsKrTv+FXSDqsMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020