UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H4vsHUOkm1X/En+QlP0Az0EqrN9TKpXUiEMsK9hlSD0=' 
WHERE 
  key_id = '929676690324f2cb728c6f4ccf1d3079025d84840a9d1497c94a437395d0de83' 
  AND (
    token = 'H4vsHUOkm1X/En+QlP0Az0EqrN9TKpXUiEMsK9hlSD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021