UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RnSL/9PnKeuUvBuGrGW08Of1sAux55n7oPafs2uDW1E=' 
WHERE 
  key_id = '60e86a3fc2909055715bb0c500910ade7708c475cf3b1b91e3f49c52b19babf1' 
  AND (
    token = 'RnSL/9PnKeuUvBuGrGW08Of1sAux55n7oPafs2uDW1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030