UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvFJ+TJXqWmtgdoRUXy+ZRvOfXTh74Mpv1eOafbdAwI=' 
WHERE 
  key_id = '90d16bfb594c3f4658ec8dae20b43dac5f9803bca243871c923920aa078b0fe0' 
  AND (
    token = 'xvFJ+TJXqWmtgdoRUXy+ZRvOfXTh74Mpv1eOafbdAwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019