UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MyEBKFgpgtSa/tWWp7Np+UzEgr++Qxj7ppYyVEQZRug=' 
WHERE 
  key_id = 'c4db557ff36146cca0ba8a8262dc1d0800493c05f1950dcbda2642aa8f9c257d' 
  AND (
    token = 'MyEBKFgpgtSa/tWWp7Np+UzEgr++Qxj7ppYyVEQZRug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043