UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2vKsGkT5i9/gJBKrB35wyP63NZxSGrmPAm/RRe1tbHc=' 
WHERE 
  key_id = '62f86b5c0ee607c806129fde7bfe029671835dea9eca682b0d7fae13468a4762' 
  AND (
    token = '2vKsGkT5i9/gJBKrB35wyP63NZxSGrmPAm/RRe1tbHc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035