UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vwaVqQf3zRxs/NS5cfMVr/vyvBUIWr+Fe13fVH5l9OA=' 
WHERE 
  key_id = '788a4e2326f16a8927dacfd88e3ddb31bbed7391abaf56d88743fa2674fdc3a2' 
  AND (
    token = 'vwaVqQf3zRxs/NS5cfMVr/vyvBUIWr+Fe13fVH5l9OA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021