UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'syzU6AUDvQuI5phAtFrjRo+I5NwvT9I28tj5mpvhjTw=' 
WHERE 
  key_id = '87157c10a091bd94e02a4a11b81150e41ffcee809176136ef308999e2fc05979' 
  AND (
    token = 'syzU6AUDvQuI5phAtFrjRo+I5NwvT9I28tj5mpvhjTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016